#coding: utf-8

import socket

sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.connect(('www.yahoo.com',80))
sock.send('GET /index.html HTTP/1.0\r\n\r\n')
print sock.readable()
data=sock.recv(819200)
fp=open('yahoo','wb')
fp.write(data)
fp.close()
print data
sock.close()